-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLDR-17686 change enum.valueOf to enum.forString in a couple of places #3774
base: main
Are you sure you want to change the base?
Conversation
- these were causing odd compilation errors on one environment
Deleting maven cache seemed to make this error go away. |
pageId = PageId.valueOf(args.page); | ||
} catch (IllegalArgumentException iae) { | ||
pageId = PageId.forString(args.page); | ||
if (pageId == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this returns null if it catches the exception?
public static PageId forString(String name) {
try {
return PageIdNames.forString(name);
} catch (Exception e) {
throw new ICUException("No PageId for " + name, e);
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a feature of Java I wasn't familiar with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, that would throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right; I misread it. It catches IllegalArgumentException then throws ICUException.
So the removal of catch (Throwable t)
means that searchPathheader may throw ICUException where before it wouldn't have. That goes beyond merely changing valueOf to forString. Here q
comes from an http request, so it could be anything... Line 765 of SurveyAjax will catch it:
} catch (Throwable e) {
SurveyLog.logException(
logger, e, "Error in SurveyAjax?what=" + what + ": " + e.getMessage());
sendError(out, e);
}
I guess that's OK, though shouldn't searchPathheader then be declared to throw ICUException? It still silently catches other exceptions further below; it just seems a little arbitrary...
pageId = PageId.valueOf(args.page); | ||
} catch (IllegalArgumentException iae) { | ||
pageId = PageId.forString(args.page); | ||
if (pageId == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right; I misread it. It catches IllegalArgumentException then throws ICUException.
So the removal of catch (Throwable t)
means that searchPathheader may throw ICUException where before it wouldn't have. That goes beyond merely changing valueOf to forString. Here q
comes from an http request, so it could be anything... Line 765 of SurveyAjax will catch it:
} catch (Throwable e) {
SurveyLog.logException(
logger, e, "Error in SurveyAjax?what=" + what + ": " + e.getMessage());
sendError(out, e);
}
I guess that's OK, though shouldn't searchPathheader then be declared to throw ICUException? It still silently catches other exceptions further below; it just seems a little arbitrary...
Please take a pass through PRs to make sure that they are merged before we branch (if there are other merges on the ticket) |
CLDR-17686
ALLOW_MANY_COMMITS=true